<@html>
<script type="text/javascript">
	dojo.require("dijit.dijit");
	dojo.require("dijit.form.Form");
	dojo.require("dijit.form.Button");
	dojo.require("dijit.form.ValidationTextBox");
</script>
<@queryForm>
<table>
	<tr>
		<td>
		<@s.text name="code"/>：
		</td>
		<td>
			<input type="hidden" name="condition[0].propertyName" value="code"/>
			<input type="hidden" name="condition[0].operator" value="LIKE"/>
			<input type="hidden" name="condition[0].matchMode" value="BEFORE"/>
			<input id="code" name="condition[0].value" dojoType="dijit.form.ValidationTextBox" required="true"/>
		</td>
		<td>
		<@s.text name="chineseDesc"/>：
		</td>
		<td>
			<input type="hidden" name="condition[1].propertyName" value="chineseDesc"/>
			<input type="hidden" name="condition[1].operator" value="LIKE"/>
			<input type="hidden" name="condition[1].matchMode" value="BEFORE"/>
			<input id="chineseDesc" name="condition[1].value" dojoType="dijit.form.ValidationTextBox" required="true"/>
		</td>
		<td>
		<@s.text name="englishDesc"/>：
		</td>
		<td>
			<input type="hidden" name="condition[2].propertyName" value="englishDesc"/>
			<input type="hidden" name="condition[2].operator" value="LIKE"/>
			<input type="hidden" name="condition[2].matchMode" value="BEFORE"/>
			<input id="englishDesc" name="condition[2].value" dojoType="dijit.form.ValidationTextBox"/>
		</td>
	</tr>
	<tr>
		<td>
		<@s.text name="produceTag"/>：
		</td>
		<td>
			<input type="hidden" name="condition[3].propertyName" value="produceTag"/>
			<input type="hidden" name="condition[3].operator" value="LIKE"/>
			<input type="hidden" name="condition[3].matchMode" value="BEFORE"/>
			<input id="produceTag" name="condition[3].value" dojoType="dijit.form.ValidationTextBox"/>
		</td>
		<td>
		<@s.text name="produceRfTag"/>：
		</td>
		<td>
			<input type="hidden" name="condition[4].propertyName" value="produceRfTag"/>
			<input type="hidden" name="condition[4].operator" value="LIKE"/>
			<input type="hidden" name="condition[4].matchMode" value="BEFORE"/>
			<input id="produceRfTag" name="condition[4].value" dojoType="dijit.form.ValidationTextBox"/>
		</td>
		<td>
		<@s.text name="produceInputControl"/>：
		</td>
		<td>
			<input type="hidden" name="condition[5].propertyName" value="produceInputControl"/>
			<input type="hidden" name="condition[5].operator" value="LIKE"/>
			<input type="hidden" name="condition[5].matchMode" value="BEFORE"/>
			<input id="produceInputControl" name="condition[5].value" dojoType="dijit.form.ValidationTextBox"/>
		</td>
	</tr>
	<tr>
		<td>
		<@s.text name="produceFormat"/>：
		</td>
		<td>
			<input type="hidden" name="condition[6].propertyName" value="produceFormat"/>
			<input type="hidden" name="condition[6].operator" value="LIKE"/>
			<input type="hidden" name="condition[6].matchMode" value="BEFORE"/>
			<input id="produceFormat" name="condition[6].value" dojoType="dijit.form.ValidationTextBox"/>
		</td>
</table>

<div id="seniorQueryCondition" title="高级查询条件">
</div>
</@queryForm>
<@toolbar/>
<link rel="stylesheet" href="${(path)!}/js/dojo/dojox/grid/resources/${(theme)!}Grid.css">
<script type="text/javascript" language="javascript">
	dojo.require("dojox.data.QueryReadStore");
	dojo.require("widget.navgrid.NavGrid");
</script>
<table id="grid" dojoType="widget.navgrid.NavGrid"
       selectionMode="single" rowsPerPage="10"
       structure="layout" autoHeight="true">
</table>
</@html>
<script language="javascript" type="text/javascript">
	var store = new dojox.data.QueryReadStore({
				url : "${(path)!}/master/batchsprop.list.do",
				requestMethod : "post"
			});
	var layout = [
		{
		},
		{
			cells : [
				[
					{
						name : "<@s.text name="code"/>"
						,field : "code"
						,width:"14%"
						,headerClasses:"gridHeader"
					}			,
					{
						name : "<@s.text name="chineseDesc"/>"
						,field : "chineseDesc"
						,width:"14%"
						,headerClasses:"gridHeader"
					}			,
					{
						name : "<@s.text name="englishDesc"/>"
						,field : "englishDesc"
						,width:"14%"
						,headerClasses:"gridHeader"
					}			,
					{
						name : "<@s.text name="produceTag"/>"
						,field : "produceTag"
						,width:"14%"
						,headerClasses:"gridHeader"
					}			,
					{
						name : "<@s.text name="produceRfTag"/>"
						,field : "produceRfTag"
						,width:"14%"
						,headerClasses:"gridHeader"
					}			,
					{
						name : "<@s.text name="produceInputControl"/>"
						,field : "produceInputControl"
						,width:"14%"
						,headerClasses:"gridHeader"
					}			,
					{
						name : "<@s.text name="produceFormat"/>"
						,field : "produceFormat"
						,width:"14%"
						,headerClasses:"gridHeader"
					}
				]
			]
		}
	];
	dojo.ready(function() {
		//事件注册
		//新增
		dojo.connect(dijit.byId("btnAdd"), "onClick", function() {
			parent.openDialog({
						id:"batchsprop/add",
						url:"${(path)!}/master/batchsprop.load.do?processType=add",
						title:"新增"
					});
		});
		//编辑
		dojo.connect(dijit.byId("btnEdit"), "onClick", function() {
			var selection = dijit.byId("grid").selection.getSelected();
			if (!selection || selection.length == 0) {
				window.parent.Error("您未选择数据！");
				return;
			}
			var id = store.getValue(selection[0], "id");
			parent.openDialog({
						id: "batchsprop/update",
						url : "${(path)!}/master/batchsprop.load.do?processType=update&batchsProp.id=" + id,
						title : "修改",
						width : 800,
						height : 600
					});
		});
		//查看
		dojo.connect(dijit.byId("grid"), "onRowDblClick", function(e) {
			if (e.rowIndex > -1) {
				var item = dijit.byId("grid").getItem(e.rowIndex);
				if (store.isItem(item)) {
					var id = store.getIdentity(item);
					parent.openDialog({
								id: "batchsprop/View",
								url : "${(path)!}/master/batchsprop.load.do?processType=view&batchsProp.id=" + id,
								title : "查看",
								width : 800,
								height : 600
							})
				}
			}
		});
		//删除
		dojo.connect(dijit.byId("btnDelete"), "onClick", function() {
			var selection = dijit.byId("grid").selection.getSelected();
			if (!selection || selection.length == 0) {
				window.parent.Error("您未选择数据！");
				return;
			}
			var id = store.getValue(selection[0], "id");
			parent.Confirm({
						msg : "确认删除数据吗？",
						okCall : function() {
							dojo.xhrGet({
										url:"${(path)!}/master/batchsprop.delete.do?batchsProp.id=" + id,
										handleAs:"json",
										load:function(json) {
											window.parent.Info("删除成功！", function() {
												dijit.byId("grid").reload();
											});
										}
									})
						}
					})
		});
		//查询
		dojo.connect(dijit.byId("btnQuery"), "onClick", function() {
			dijit.byId("grid").setStore(store, dojo.formToObject("queryForm"));
		});
		//注册响应函数
		parent.subscribe("${(pageId)!}", "batchsprop/refresh", null, function() {
			dijit.byId("grid").reload();
		});
	})
</script>
